/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* This can be set to anything, but default usage is:
*
*     development
*     testing
*     production
*/
var myConfig = [
    {
        ENVIRONMENT: 'development',
        SHOW_TESTCASES:false
    }
];
var myObject = 
{
    mode:null,
    id:null,
    hasDeleteHandler:false,
    groupReference:null,
    groupId:null
};
log = console.log;

/*
* Alert html helper method
* 
* @param string
* @param type (info, success, error) 
*/ 
function alert_html(string,type)
{
    html = '<div class="alert alert-'+type+' clearfix">'
    '<button type="button" class="close" data-dismiss="alert">&times;</button>'
    html+= string; 
    html+= '</div>';
    return html;  
}

/*
* Loader html helper method
* 
*/ 
function loader_html()
{
    return '<div class="alert"><img src="'+base_url+'assets/img/backgnds/loading.gif"></div>';
} 

/*
* Edit Object Dialog
* 
* @param urlToOpen
* @param dialogClass
* @param dialogTitle
* @param buttons collection
* @param DialogOnOpen
* @param width
* @param heigh
* 
*/
newDialog = function(urlToOpen,dialogClass,dialogTitle,buttons,DialogOnOpen,width,height){  

    var tag = $("<div class='"+dialogClass+"'></div>");

    $.ajax({
            url: urlToOpen,
            // Disable caching of AJAX responses
            cache: false,
            success: function(data) { 

                tag.html(data).dialog({
                        height: height,
                        width: width,
                        modal: true,
                        title: dialogTitle,
                        buttons:buttons,                        
                        open: DialogOnOpen,
                        close: function() {
                            $(this).dialog("destroy").remove();
                        }
                }).dialog('open');
            }
    });
}